package com.example.javascaffold.utils;


import lombok.NonNull;

import java.util.HashMap;
import java.util.Map;

/**
 * //TODO 返回结果集合
 * @author song
 * @date 15:39 2021/8/23
 * @param
 * @return
 * @other
**/
public class R extends HashMap<String, Object> {

    private static final long serialVersionUID = 1L;

    public R() {

    }

    public static R data() {
        return new R();
    }

    public static R data(Object data) {
        R r = new R();
        r.put("result", data);
        return r;
    }

    public static R data(Map<String, Object> map) {
        R r = new R();
        r.putAll(map);
        return r;
    }

    @NonNull
    @Override
    public R put(String key, Object value) {
        super.put(key, value);
        return this;
    }
}
